package com.antu.first.enums;

/**
 * Created by Administrator on 2018/3/13.
 */
public enum DiscountCouponEnum {

    QUERY_SUCCESS(0,"优惠券查询成功！"),QUERY_FAILED(-1,"您暂时没有优惠券！"),IS_LAST(-101,"已经是最后一页了！");

    private int state;

    private String stateInfo;

    DiscountCouponEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public static DiscountCouponEnum valueOf(int key){
        for(DiscountCouponEnum stateEnum : values()){
            if(stateEnum.getState() == key){
                return stateEnum;
            }
        }
        return null;
    }

}
